package com.zoespeer.food_delivery_comment_api.controller;

import com.zoespeer.food_delivery_comment_api.common.ApiResponse;
import com.zoespeer.food_delivery_comment_api.service.CategoryService;
import com.zoespeer.food_delivery_comment_api.vo.CategoryListVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/category")
@RequiredArgsConstructor
public class CategoryController {

    private final CategoryService categoryService;

    @GetMapping("/list")
    public ApiResponse<CategoryListVO> getAllCategories() {
        CategoryListVO data = categoryService.getAllCategories();
        return ApiResponse.success(data, "获取分类列表成功");
    }
}